<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>yoyo扎金花</title>
    <base href="${Context}">
    <link rel="stylesheet" type="text/css" href="css/metro/easyui.css">
    <link rel="stylesheet" type="text/css" href="css/theme/mobile.css">
    <link rel="stylesheet" type="text/css" href="css/theme/icon.css">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="js/jquery.easyui.mobile.js"></script>
    <style type="text/css">
    	.bottomMenu{
    		    font-size: 16px;
			    margin: 0px;
			    line-height: 100%;
			    height: 50px;
			    vertical-align: middle;
			    padding: 0px 10px;
			    display: table-cell;
    	}
    	.bottomMenuSpan{
    		    border: 1px solid black;
			    margin-top: 1%;
			    height: 50px;
			    width: 55px;
    	}
    	.bottomMenu:HOVER {
			background-color: #999999;
		}
    </style>
</head>
<body onload="onloadbody()">
<div class="easyui-navpanel" style="position:relative">
    <header>
        <div class="m-toolbar">
            <div id="HeadTitle" class="m-title"></div>
            <div class="m-left">
                <a href="javascript:void(0)" class="easyui-linkbutton" plain="true" outline="true" style="width:80px"
                   onclick="OnClickChangeGame()">扎金花
                </a>
            </div>
            <div class="m-right">
                <form id="quitff" action="${Context}/user/login" method="post">
                    <a href="javascript:void(0)" class="easyui-linkbutton" plain="true" outline="true"
                      width="100%" height="100%" onclick="OnClickQuit()" >退出</a>
                </form>
            </div>
        </div>
    </header>
    <iframe id="Content" scrolling="yes" frameborder="0" marginwidth="0" marginheight="0"
            src="#" width="100%" height="100%" allowTransparency="true" ></iframe>

    <div id="TabMenu" class="m-buttongroup m-buttongroup-justified" style="width:100%;">
    	
    </div>

</div>
</body>
<script type="text/javascript">
var sys=sys || {};
sys.context = "${Context}";
sys.contextPath="${ContextPath}";
function onloadbody(){
	var nContentH = document.body.clientHeight - 106;
   	$('#Content').css('height', nContentH + 'px');
   	
   	//alert(nContentH);
}
    (function () {
        var bIsMobile = false;
        var oBrowser = {
            versions: function () {
                var u = navigator.userAgent;
                return { //移动终端浏览器版本信息
                    trident: u.indexOf('Trident') > -1, //IE内核
                    presto: u.indexOf('Presto') > -1, //opera内核
                    webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), //是否为移动终端
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
                    iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
                    iPad: u.indexOf('iPad') > -1, //是否iPad
                    webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
                };
            }(),
            language: (navigator.browserLanguage || navigator.language).toLowerCase()
        }
        sys.oBrowser=oBrowser;
        if (oBrowser.versions.iPhone || oBrowser.versions.iPad) {
            bIsMobile = true;
        } else if (oBrowser.versions.android) {
            bIsMobile = true;
        } else {
            bIsMobile = false;
        }
        var aTabData = [
            {
                'title': '成员管理',
                'icon': 'icon-large-club',
                'url': sys.context+'main/getSubAgent',
                'home':1
            },
            {
                'title': '下级管理',
                'icon': 'icon-large-smartart',
                'url': sys.context+'main/getSubManager',
                'home': 0
            },
            {
                'title': '日报记录',
                'icon': 'icon-large-picture',
                'url': sys.context+'main/dayRecord',
                'home': 0
            },
            {
                'title': '进货',
                'icon': 'icon-large-clipart',
                'url': sys.context+'main/stock',
                'home': 0
            }
        ];

        InitView();

        function InitView() {
            for (var i = 0; i < aTabData.length; ++i) {
                var oItemData = aTabData[i];

                //var oBtnTab = $('<a>').attr('href', 'javascript:void(0)').attr('class', 'easyui-linkbutton l-btn TabItem')
                //	.attr("data-index",i)
                 //   .css("border","0px").html('<span class="l-btn-left bottomMenuSpan"><div class="l-btn-text bottomMenu" >'+oItemData.title+'</div></span>');
                 var oBtnTab = $('<a>').attr('href', 'javascript:void(0)').attr('class', 'easyui-linkbutton TabItem')
                    .attr('data-options', "iconCls:'" + oItemData.icon +
                        "',size:'large',iconAlign:'top',plain:true").attr('data-index', i).text(oItemData.title);
                $('#TabMenu').append(oBtnTab);
                if (oItemData.home) {
                	$("#Content", parent.document.body).attr("src", oItemData.url);
                	$("#HeadTitle").html(oItemData.title);
                }
            }

            if (bIsMobile) {
                $('.TabItem').on('touchend', OnClickTabItem);
            } else {
                $('.TabItem').on('click', OnClickTabItem);
            }
		
            
           	
        }

        function OnClickTabItem() {
            var nIndex = $(this).attr('data-index');
            if (nIndex < aTabData.length) {
                var oItemData = aTabData[nIndex];
                $("#Content", parent.document.body).attr("src", oItemData.url);
                $("#HeadTitle").html(oItemData.title);
            }
        }

    })();

    function OnClickQuit() {
        var result = confirm('确认退出系统吗！');
        if (result) {
            $('#quitff').submit();
        }
    }

    function OnClickChangeGame() {
        window.location.href = sys.context+'user/login';
    }
</script>
</html>